# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=wacomtablet
pkgver=6.2.3
pkgrel=0
pkgdesc="GUI for Wacom Linux drivers that supports different button/pen layout profiles"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="GPL-2.0-or-later"
depends="xinput"
makedepends="
	extra-cmake-modules
	kconfig-dev
	kcoreaddons-dev
	kdbusaddons-dev
	kdoctools-dev
	kglobalaccel-dev
	ki18n-dev
	knotifications-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	libwacom-dev
	libplasma-dev
	plasma5support-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	samurai
	xf86-input-wacom-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-lang $pkgname-doc"
_repo_url="https://invent.kde.org/system/wacomtablet.git"
case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
source="https://download.kde.org/$_rel/plasma/$pkgver/wacomtablet-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure \
		-E "Test.KDED.DBusTabletService"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
6880516d10fb74c1b3aa8e6329d9caba3df6080f39dce619db4df8155f01e7e30ba948425828fcf911314a8552b1ffdf5af54ebb4d8181cc601fc276944360b9  wacomtablet-6.2.3.tar.xz
"
